import Vue from 'vue'
Vue.directive('errorimg', {
  inserted(dom, obj, vnode) {
    dom.src = dom.src || obj.value || require('@/assets/common/ai.jpg')
    dom.onerror = () => {
      dom.src = obj.value || require('@/assets/common/ai.jpg')
    }
  },
  componentUpdated(dom, obj, vnode) {
    dom.src = dom.src || obj.value || require('@/assets/common/ai.jpg')
  }
})
